1. Field of the Invention
The present invention generally relates to a method for switching power states, and more particularly, to a method for automatically switching power states ahead of and after executing an assigned function.
2. Description of Related Art
The power management is considered as an important function of a general desktop computer and a portable electronic equipment powered by batteries (for example, notebook). At the present time with rising environmental and energy consciousness, people may want to make a contribution for environmental protection though the proper power management while taking enjoyments in conveniences brought by computers. That is to say, whenever a computer is in vacancy state, the computer is forced into a shutdown state, a hibernate state or a standby state so as to save energy and meanwhile to reduce exhaust heat.
The power management with a computer system nowadays mostly complies with advanced configuration and power interface standard (ACPI standard). According to ACPI standard, the power states include six states of S0-S5, wherein S0 state is just the so-called working state, and the rest S1-S5 states respectively represent different extents of the power-saving state by a power supply.
In general, whenever a computer system enters a power-saving state, the computer does not run a program anymore; in case a user specifies a computer system to execute an assigned function at a preset time, the computer must be kept in the S0 state all the time, which not only consumes power, but also shortens the computer life and affects the stability thereof on a long term view. On the other hand, even if a computer system is automatically switched on from a power-saving state at a preset time to execute an assigned function by means of configured circuit hardware plus program software, the computer still fails to automatically go back into the previous power-saving state.
For example, if a user takes a foreign tour for a week and the computer is scheduled to be automatically turned on in the evening on the third day to record a TV program for an hour, but the computer may fail to be restored into the previous power state after the TV program is recorded. As a result, the computer has to be in the switching-on state for the following four days without executing any program, which not only consumes power, but also shortens the computer life.